package com.classroom.smart.controller;

import com.classroom.smart.pojo.Feedback;
import com.classroom.smart.result.Result;
import com.classroom.smart.service.FeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/feedback")
public class FeedbackController {

    @Autowired(required = false)
    private FeedbackService feedbackService;

    @PostMapping("/submit")
    public Result submit(Feedback feedback){
        System.out.println("执行插入" + feedback);
        feedbackService.insert(feedback);
        System.out.println("插入成功");
        Result result = new Result();
        result.setFlag(true);
        return result;

    }
}
